public class Solution1822 {
    public int arraySign(int[] nums) {
        int ans=1;
        for (int num : nums) {
            if (num<0){
                ans=-ans;
            }else if (num==0){
                return 0;
            }
        }
        return ans;
    }

    public static void main(String[] args) {
        System.out.println(new Solution1822().arraySign(new int[]{-1,-2,-3,-4,3,2,1}));
    }
}
